package SwordForOffer.Problem19;

public class MyMirrorRecursively {
    public BinaryTreeNode mirrorRecursively(BinaryTreeNode root) {

        if (root == null){
            return null;
        }

        if (root.leftNode == null && root.rightNode == null){
            return root;
        }

        BinaryTreeNode treeNode = root.leftNode;
        root.leftNode = mirrorRecursively(root.rightNode);
        root.rightNode = mirrorRecursively(treeNode);
        return root;


    }
}
